Software tools for generating source code from a high-level description simplify software development by allowing a programmer to focus on the high-level description rather having to write the complex, generated code themselves. A drawback of such systems is that generated code often bears little or no resemblance to the high-level description. This makes it unintuitive for programmers to incorporate the generated code into their projects. The cryptic nature of generated code can be alleviated somewhat by the automatic insertion of comment text. But while comments may aid readability of the generated code to some extent, a programmer writing software that depends on the generated code will need to frequently examine the high-level description and the generated code in the course of writing the dependent code. Having to repeatedly switch back and forth between documents can cause programmers to lose their focus. Gains in productivity made by automatically generating source code can be mitigated by the cumbersome nature in which it is used. Accordingly, what is needed is a way to enrich interactive tools and software development environments with knowledge of the relationships between documents such that programmers will not lose their context when working with generated code.